check if the object is array in javascript